<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateServerinfosTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('serverinfos', function(Blueprint $table)
		{
			$table->increments('serverinfo_id');
			$table->string('register_number');
			$table->timestamp('end_time');
			$table->boolean('is_use');
			$table->integer('usergroup_id')->unsigned();
			$table->timestamps();

			$table->foreign('usergroup_id')->references('usergroup_id')->on('usergroups');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('serverinfos');
	}

}
